import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { OrderVerifyVO, OrderVerifyForm, OrderVerifyQuery } from '@/api/kitchen/order/verify/types';

/**
 * 查询订单核销记录列表
 * @param query
 * @returns {*}
 */

export const listOrderVerify = (query?: OrderVerifyQuery): AxiosPromise<OrderVerifyVO[]> => {
  return request({
    url: '/kitchen/orderVerify/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询订单核销记录详细
 * @param id
 */
export const getOrderVerify = (id: string | number): AxiosPromise<OrderVerifyVO> => {
  return request({
    url: '/kitchen/orderVerify/' + id,
    method: 'get'
  });
};

/**
 * 新增订单核销记录
 * @param data
 */
export const addOrderVerify = (data: OrderVerifyForm) => {
  return request({
    url: '/kitchen/orderVerify',
    method: 'post',
    data: data
  });
};

/**
 * 修改订单核销记录
 * @param data
 */
export const updateOrderVerify = (data: OrderVerifyForm) => {
  return request({
    url: '/kitchen/orderVerify',
    method: 'put',
    data: data
  });
};

/**
 * 删除订单核销记录
 * @param id
 */
export const delOrderVerify = (id: string | number | Array<string | number>) => {
  return request({
    url: '/kitchen/orderVerify/' + id,
    method: 'delete'
  });
};
